export default function createImgCodeSchema(codeName, codeId, serviceId) {
    return {
        type: 'group',
        label: '图形验证码',
        required: true,
        name: 'input-group-code' || ('input-group-' + codeName),
        body:[
            {
                type: 'input-text',
                label: false,
                placeholder: '请输入验证码',
                required: true,
                name: codeName || 'code',
                id: codeId || 'code',
                validationErrors: {
                    isRequired: '请输入验证码'
                },
            },
            {
                type: 'service',
                id: serviceId || 'service-img-code',
                api: '/base/captcha/image',
                body: [
                {
                    type: 'image',
                    width: 120,
                    height: 30,
                    thumbMode: 'cover',
                    innerClassName: 'no-border',
                    src: '${base64}',
                    clickAction: {
                        target: serviceId || 'service-img-code',
                        actionType: 'reload'
                    },
                    //和文本框对齐，并吸附在文本框右侧
                    style:{
                        'margin-top': '-4px',
                        'margin-left': '-20px'
                    }
                }]
            }
        ]
    }
}